/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.general.be;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.cip.esymons.colegiatura.be.Colegiado;
/**
 *
 * @author ADMINISTRADOR
 */
@Entity
@Table(name = "gen_pais")
//@NamedQueries({@NamedQuery(name = "Pais.findAll", query = "SELECT p FROM Pais p"),
//@NamedQuery(name = "Pais.findByPaiCodigo", query = "SELECT p FROM Pais p WHERE p.paiCodigo = :paiCodigo"),
//@NamedQuery(name = "Pais.findByPaiDescripcion", query = "SELECT p FROM Pais p WHERE p.paiDescripcion = :paiDescripcion")})
public class Pais implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pai_codigo", nullable = false)
    private Integer paiCodigo;
    @Basic(optional = false)
    @Column(name = "pai_descripcion")
    private String paiDescripcion;
    @Basic(optional = false)
    @Column(name = "pai_bandera")
    private String paiBandera;

    @OneToMany(mappedBy = "pais", fetch = FetchType.LAZY)
    private List<Colegiado> colegiadoCollection;

    public Pais() {
    }

    public Pais(Integer paiCodigo) {
        this.paiCodigo = paiCodigo;
    }

    public Pais(Integer paiCodigo, String paiDescripcion) {
        this.paiCodigo = paiCodigo;
        this.paiDescripcion = paiDescripcion;
    }

    public Integer getPaiCodigo() {
        return paiCodigo;
    }

    public void setPaiCodigo(Integer paiCodigo) {
        this.paiCodigo = paiCodigo;
    }

    public String getPaiDescripcion() {
        return paiDescripcion;
    }

    public void setPaiDescripcion(String paiDescripcion) {
        this.paiDescripcion = paiDescripcion;
    }

    public String getPaiBandera() {
        return paiBandera;
    }

    public void setPaiBandera(String paiBandera) {
        this.paiBandera = paiBandera;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (paiCodigo != null ? paiCodigo.hashCode() : 0);
        return hash;
    }

    public List<Colegiado> getColegiadoCollection() {
        return colegiadoCollection;
    }

    public void setColegiadoCollection(List<Colegiado> colegiadoCollection) {
        this.colegiadoCollection = colegiadoCollection;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pais)) {
            return false;
        }
        Pais other = (Pais) object;
        if ((this.paiCodigo == null && other.paiCodigo != null) || (this.paiCodigo != null && !this.paiCodigo.equals(other.paiCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.general.be.Pais[paiCodigo=" + paiCodigo + "]";
    }

}
